<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.util.Properties" %>
<%@ page import="cn.ffcs.security.model.User" %>
<%@ page import="cn.ffcs.security.web.UserContext" %>
<%
 User user=((UserContext)session.getAttribute("LOGINUSER_CONTEXT")).getCurrUser();
 Properties prop = new Properties(); 
 InputStream in = null; 
 String url="";
 try { 
     in=this.getClass().getResourceAsStream("/sp-server.properties");
     prop.load(in); 
     url=prop.getProperty("contract.server.url");
 } catch (IOException e) { 
     e.printStackTrace(); 
 } finally{
     if (in != null) {
         try {
             in.close();
         } catch (Exception e) {
         }
     }
 }

 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>

<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/formValidator.js"/>" type="text/javascript" charset="UTF-8"></script>
<script src="<s:url value="/script/formValidatorRegex.js"/>" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="<s:url value="/script/DateTimeMask.js"/>" type="text/javascript"></script>
<script type="text/javascript" src="<s:url value="/script/selfResize.js"/>"></script>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({autotip:true,onerror:function(msg){alert(msg)}});
	$("select[name='contractInfo.referenceType.id']").formValidator({tipid:"referenceTypetip",onshow:"资料类型"}).inputValidator({onerror:"您还没有输入资料类型",empty:{leftempty:false,rightempty:false,emptyerror:"资料类型不能为空"}});
	$("input:text[name='contractInfo.title']").formValidator({tipid:"titletip",onshow:"标题"}).inputValidator({min:1,onerror:"您还没有输入标题",empty:{leftempty:false,rightempty:false,emptyerror:"标题两边不能有空符号"}});
	$("textarea[name='contractInfo.content']").formValidator({tipid:"contenttip",onshow:"内容"}).inputValidator({min:1,max:300,onerror:"您输入的描述长度不正确,请确认"});
	$("input:text[name='contractInfo.keyword']").formValidator({tipid:"keywordtip",onshow:"关键字"}).inputValidator({min:1,onerror:"您还没有输入资料关键字",empty:{leftempty:false,rightempty:false,emptyerror:"关键字两边不能有空符号"}});
});
</script>

<script type="text/javascript">
function show(url){
	window.open(url);
}
function initLoad(){
	f_iframeResize();
}
window.onload = initLoad;
</script>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link rel="stylesheet" href="<s:url value="/css/validator.css"/>">
<script type="text/javascript" src="<s:url value="/components/My97DatePicker/WdatePicker.js"/>"></script>
<link href="<s:url value="/images/08_ccxxzx.css"/>" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<s:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img
						src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
						height="12" /></td>
				<td>当前位置：<font color="#003399">合同管理</font>&gt;&gt;合同会签</td>
				</tr>
			</table>
			</td>
		</tr>
	
	<tr>
		<td background="<s:url value="/images/home_4a.gif"/>">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
			<tr>
		    <td  background="<s:url value="/images/home_4a.gif"/>"> 
		      <table width="100%" height="400" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
		        <tr>
		          <td width="240" valign="top" class="leftbg">
					<%@ include file="/commons/include/contract_left.inc"%>  
				  </td>
		          <td valign="top">
						<s:form name="form1" id="form1" onsubmit="submit1()" action="saveContractInfo.action" namespace="/security" method="post" enctype="multipart/form-data" >
							<input type="hidden" name="contractInfo.id" value="${contractInfo.id}">
							<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
								<br/>
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab1.gif"/>" width="5" height="5" /></td>
												<td class="tdborderup"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab2.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td  class="tdborderleftright">
									<TABLE width="100%" cellSpacing=1 cellPadding=0 align="center">
										<TR height=30>
											<TD align=left width="10%">
				<secu:out resType="OBJECT" code="OBJ_CONTRACT_MAN">
												<input type="button" name="button" value="提交并转入归档"  onclick="document.form1.action='archiveCountersigned.action';document.form1.submit();">
				</secu:out>
												<input type="submit" IsShowProcessBar="True" name="Submit" value="提 交">
												<input type="button" value="返 回" onClick="window.history.back();">
											</TD>
										</TR>
									</table>
									<s:if test="#returnMsg==null">
									</s:if> <s:else>
										<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
											<TR height=30>
												<TD align=left width="10%"><font color="red">${returnMsg}</font>
												</TD>
											</TR>
										</table>
									</s:else>
									<table width="100%" border="0" cellspacing="0" cellpadding="7"
										align="center" class=tablecolor2>
										<tr>
											<td width="10%" bgcolor="D6E3FA" >
											<div align="right">合同名称：</div>
											</td>
											<td width="90%" colspan="3"><s:textfield name="contractInfo.contractName" theme="css_xhtml" size="80" maxlength="100"/></td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
											<div align="right">签约方名称：</div>
											</td>
											<td width="90%" colspan="3"><s:textfield name="contractInfo.signatoriesName" theme="css_xhtml" size="80" maxlength="100"/></td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
												<div align="right">第三方名称：</div>
											</td>
												<td width="90%" colspan="3"><s:textfield name="contractInfo.thirdName" theme="css_xhtml" size="80" maxlength="100"/>
											</td>
										</tr>
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">产品类别：</div>
											</td>
											<td width="35%">
												<s:select name="contractInfo.contractType.id" list="contractTypes" listKey="id" listValue="name" theme="css_xhtml" />
											</td>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">合同起草人：</div>
											</td>
											<td width="35%" >
												<input name="contractInfo.creatorName" value="${contractInfo.creatorName}" size="33" readonly/>
											</td>
										</tr>
										
										<tr>
											
										</tr>
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">版&nbsp;&nbsp;&nbsp;&nbsp;本：</div>
											</td>
											<td width="35%">
												<s:textfield name="contractInfo.version" theme="css_xhtml" size="33"/>
											</td>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">会签编号：</div>
											</td>
											<td width="35%"><s:textfield name="contractInfo.signCode" theme="css_xhtml" size="33"/>
												<s:if test="contractInfo.signCode!=null">
													<a href="javascript:void(0);" onClick="contractDetail();">
														查看合同详情</a>
												</s:if>
											</td>
										</tr>
										<!--  tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">会签提交时间：</div>
											</td>
											<td width="35%" >
												<input value="<s:date name="contractInfo.submitTime" format="yyyy年MM月dd日 HH:mm" />" size="33" readonly/>
												</td>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">目前会签部门：</div>
											</td>
												<td width="35%"><s:textfield name="contractInfo.currDept" theme="css_xhtml" size="33"/>
											</td>
										</tr -->
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">对方联系人：</div>
											</td>
											<td width="35%">
												<s:textfield name="contractInfo.contact" theme="css_xhtml" size="33"/>
											</td>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">联系电话：</div>
											</td>
											<td width="35%">
												<s:textfield name="contractInfo.contactTel" theme="css_xhtml" size="33"/>
											</td>
										</tr>
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">到达时间：</div>
											</td>
											<td width="35%">
												<input type="text" name="contractInfo.arrivalTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<s:date name="contractInfo.arrivalTime" format="yyyy-MM-dd" />" />
											</td>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">处理时间：</div>
											</td>
											<td width="35%">
												<input type="text" name="contractInfo.processTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<s:date name="contractInfo.processTime" format="yyyy-MM-dd" />" />
											</td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
												<div align="right">合作内容：</div>
											</td>
												<td width="90%" colspan="3"><s:textfield name="contractInfo.hezuoContent" theme="css_xhtml" size="80" maxlength="100"/>
											</td>
										</tr>
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">合作内容&nbsp;&nbsp;<br>简要说明：</div>
											</td>
											<td width="90%" colspan="3">
													<s:textarea rows="3" cols="80" name="contractInfo.hezuoContentInfo" theme="css_xhtml"></s:textarea>
											</td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
												<div align="right">合作模式：</div>
											</td>
												<td width="90%" colspan="3"><s:textfield name="contractInfo.hezuoMode" theme="css_xhtml" size="80" maxlength="100"/>
											</td>
										</tr>
										<tr>
											<td width="15%" bgcolor="D6E3FA">
												<div align="right">合作模式&nbsp;&nbsp;<br>具体说明：</div>
											</td>
											<td width="90%" colspan="3">
													<s:textarea rows="3" cols="80" name="contractInfo.hezuoModeInfo" theme="css_xhtml"></s:textarea>
											</td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
												<div align="right">会签意见：</div>
											</td>
											<td width="90%" colspan="3">
													<s:textarea rows="3" cols="80" name="contractInfo.advice" theme="css_xhtml"></s:textarea>
											</td>
										</tr>
										<tr>
											<td width="10%" bgcolor="D6E3FA">
												<div align="right" class="STYLE2">
													附&nbsp;&nbsp;&nbsp;&nbsp;件：
												</div>
											</td>
											<td width="90%" colspan="3">
												<table width="100%" border="0" class=tablecolor2>
													<tr>
														<td width="85%" align="center" bgcolor="D6E3FA">
															附件名称
														</td>
														<td width="15%" align="center" bgcolor="D6E3FA">
															删除
														</td>
													</tr>
													<c:forEach var="upload" items="${contractUploads}">
														<input type="hidden" name="attachIDs"
															value="<s:property value="id" />" />
														<tr>
															<td>
																<a
																	href="/business/contract/showUpload.action?id=${upload.id}"
																	target="_blank"> ${upload.fileName }
																</a>
															</td>
															<td align="center">
																<input type="checkbox" name="delIDs"
																	value="${upload.id}">
															</td>
														</tr>
													</c:forEach>
												</table>
												<br />
												<table width="100%" border="0" class=tablecolor2>
													<tr>
														<td width="" colspan="2" align="left"
															bgcolor="D6E3FA">
															附件上传
														</td>
													</tr>
													<tr>
														<td width="10px">
															&nbsp;
														</td>
														<td align="left">
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
													<tr>
														<td>
															&nbsp;
														</td>
														<td>
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
													<tr>
														<td>
															&nbsp;
														</td>
														<td>
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<s:if test="contractInfo.id>0">
										<tr>
											<td width="10%" bgcolor="D6E3FA">
											<div align="right">处理意见：</div>
											</td>
											<td width="90%" colspan="3">
													<s:textarea rows="3" cols="80" name="contractRecord.advice" theme="css_xhtml"></s:textarea>
											</td>
										</tr>
					 					</s:if>
					 					<tr>
											<td width="15%" bgcolor="D6E3FA">
											<div align="right">备&nbsp;&nbsp;&nbsp;&nbsp;注：</div>
											</td>
											<td width="85%" colspan="3">
													<s:textarea rows="3" cols="80" name="contractInfo.notes" theme="css_xhtml"></s:textarea>
											</td>
										</tr>
										<!-- 
										<tr>
											<td width="10%" bgcolor="D6E3FA">
											<div align="right">传送人员：</div>
											</td>
											<td width="90%" colspan="3">
												<s:iterator value="processors" status="st">
														<input type="checkbox" name="nextTo" value="<s:property value="name" />" checked><s:property value="name" />
												</s:iterator>
											</td>
										</tr>
										 -->
										
					 	
										<input type="hidden" name="contractInfo.nextUser" value="${contractInfo.nextUser}">
										<input type="hidden" name="contractInfo.creator" value="${contractInfo.creator}">
										<input type="hidden" name="contractInfo.createTime"
											value="<s:date name="contractInfo.createTime" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.submitTime"
											value="<s:date name="contractInfo.submitTime" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.begin"
											value="<s:date name="contractInfo.begin" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.end"
											value="<s:date name="contractInfo.end" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="flag" value="counter">
										<input type="hidden" name="contractInfo.status" value="${contractInfo.status}">
												
									</table>
									<br>[以下为处理流程]<br>
									
									<table width="98%" border="0" cellspacing="0" cellpadding="7"
										align="center" class=tablecolor2>
							<s:iterator value="contractRecords" status="st">
										<tr>
											<td width="100%" colspan="2">操作者:<s:property value="creatorName" /> <s:date name="begin" format="yyyy-MM-dd HH:mm"/></td>
										</tr>
										<tr>
											<td width="18%">
											<div>处理意见</div>
											</td>
											<td width="*"><s:property value="advice" /></td>
										</tr>
							</s:iterator>
									</table>
									
									</td>
								</tr>
								
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab3.gif"/>" width="5" height="5" /></td>
												<td class="tdborderbottom"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab4.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
							</table></td>
					</tr>
				</table>
				</s:form> 
</body>
</html>
<script>
function submit1(){
	
		document.all['contractInfo.arrivalTime'].value+=" 00:00:00";
	
	
		document.all['contractInfo.processTime'].value=document.all['contractInfo.processTime'].value+" 00:00:00";
	
}
function contractDetail(){
    var url="<%=url%>?userID=${actContract.userId}&userID_s=${actContract.userMk}&redirectUrl=contract/contractLoadAction.do?act=${actContract.act}&frameFlag=${actContract.frameFlag}&companyFlag=${actContract.companyFlag}&currDept=${actContract.currDept}&ID=${actContract.contractID}";
    //prompt("123",url);
    window.open(url,null,"height=700,width=1020,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");
}
var obj1=document.getElementById("iTR5");
if(obj1){
	obj1.style.backgroundColor="B3DEF4";
}
</script>